﻿<Window x:Class="TreeListBoxDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:TreeListBoxDemo="clr-namespace:TreeListBoxDemo"
        xmlns:pt="clr-namespace:PropertyTools.Wpf;assembly=PropertyTools.Wpf" Title="{Binding Title}" Height="800" Width="600">
    <Window.Resources>
        <DataTemplate DataType="{x:Type TreeListBoxDemo:NodeViewModel}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="/folder.png" Margin="0 0 4 0"/>
                <pt:EditableTextBlock Grid.Column="1" Text="{Binding Name}" IsEditing="{Binding IsEditing}"/>
            </Grid>
        </DataTemplate>
    </Window.Resources>
    <DockPanel>
        <StatusBar DockPanel.Dock="Bottom">
            <TextBlock Text="SelectedItem: "/>
            <TextBlock Text="{Binding SelectedItem.Name, ElementName=tree1}"/>
            <Separator/>
            <TextBlock Text="SelectedItems: "/>
            <TextBlock Text="{Binding SelectedItems.Count, ElementName=tree1}"/>
            <Separator/>
            <TextBlock Text="SelectedIndex: "/>
            <TextBlock Text="{Binding SelectedIndex, ElementName=tree1}"/>
            <Separator/>
            <Button Content="Expand" Click="ExpandClick"/>
            <Button Content="Expand all" Click="ExpandAllClick"/>
            <Slider Width="100" Value="{Binding Indentation, ElementName=tree1}" Maximum="50"/>
            <TextBlock/>
        </StatusBar>
        <pt:TreeListBox 
            x:Name="tree1" 
            Indentation="12" 
            HierarchySource="{Binding Root}"
            BorderThickness="0"
            pt:TreeListBoxDragDropHelper.IsDragSource="True" pt:TreeListBoxDragDropHelper.IsDropTarget="True"
            KeyDown="tree1_KeyDown_1"/>

    </DockPanel>
</Window>
